package com.dp.appi.dao.impl;

import com.dp.appi.dao.PhotoDao;
import com.dp.appi.dao.SysConfigDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * Created by chenghao on 2015/9/30.
 */
@Component
public class PhotoDaoImpl extends BaseDaoImpl implements PhotoDao {


    @Override
    public List<Map<String, Object>> getPhotoTypeByOrgId(String orgid) {
        StringBuilder sb = new StringBuilder();
        sb.append("select * ");
        sb.append(" from z_ptype zp");
         sb.append(" where zp.orgids like ? ");
        return getJdbcTemplate().queryForList(sb.toString(), new Object[]{"%"+orgid+"%"});
    }

    @Override
    public List<Map<String,Object>> getRecordProject(Long stageid, Long lasttime) {
        StringBuilder sb = new StringBuilder();
        sb.append("select * ");
        sb.append(" from z_record zr");
        sb.append(" where zr.sid = ?  and lasttime > ?");
        return getJdbcTemplate().queryForList(sb.toString(), new Object[]{stageid,lasttime});
    }
    @Override
    public  List<Map<String,Object>> getPhoneProject(Long stageid,Long lasttime) {
        StringBuilder sb = new StringBuilder();
        sb.append("select * ");
        sb.append(" from z_photo zp ");
        sb.append(" where zp.sid = ?  and lasttime > ?");
        return getJdbcTemplate().queryForList(sb.toString(), new Object[]{stageid,lasttime});
    }

}
